﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPages/AdminMasterPage.Master" CodeBehind="NewsListEdit.aspx.vb" Inherits="LinhKienMayTinh.NewsListEdit" %>
<%@ Import Namespace="LinhKienMayTinh.CommonMethods" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPage" runat="server">
<div class="news-list-edit">
    <div class="title">
        Danh sách tin tức
    </div>
    <div style="text-align:right;">
        <asp:Button ID="btnAdd" runat="server" Text="Add new" />
    </div>
    <table>
        <tr>
            <th style="border-right: 1px solid gray;">
                CODE
            </th>
            <th  style="border-right: 1px solid gray;">
                Title
            </th>
            <th  style="border-right: 1px solid gray;">
                UdDate
            </th>
            <th>
                Deleted
            </th>
        </tr>
        <% 
            If IsNothing(dsSource) = False AndAlso dsSource.Tables(0).Rows.Count > 0 Then
                Dim i As Integer = 1
                For Each row In dsSource.Tables(0).Rows
        %>
        <tr>
            <td class="column-1">
                <%=row("CODE")%>
            </td>
            <td class="column-2">
                <a href="NewsEdit.aspx?Code=<%=row("CODE")%>"><%=row("TITLE")%></a>
            </td>
            <td class="column-3">
                <%= DirectCast(Nz(row("UD_DATE"), ""), DateTime).ToString("dd/MM/yyyy HH:mm")%>
            </td>
            <td class="column-4">
                <%=IIf(CInt(row("DEL_FLG")) = 0, "", "Đã delete")%>
            </td>
        </tr>
        <%
                    If i = 1 Then
                        i = 2
                    Else
                        i = 1
                    End If
                Next
            Else
        %>
            <tr>
                <td class="column-1">
                    Null
                </td>
                <td class="column-2">
                    Null
                </td>
                <td class="column-3">
                    Null
                </td>
                <td class="column-4">
                    Null
                </td>
            </tr>  
        <%
            End If
        %>
        </table>
</div>
</asp:Content>
